package org.itstack.demo.netty.future;

import org.itstack.demo.netty.msg.Response;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

public interface WriteFuture<T> {

    Throwable cause();

    void setCause(Throwable cause);

    boolean isWriteSuccess();

    void setWriteResult(boolean result);

    String requestId();

    T response();

    void setResponse(Response response);

    boolean isTimeout();

    Response get(long timeout, TimeUnit timeUnit) throws Exception;
}
